package com.github.appintro.indicator;

import ohos.agp.components.Component;
import ohos.app.Context;

public interface IndicatorController {
    int selectedIndicatorColor = 0;
    int unselectedIndicatorColor = 0;

    /**
     * Create a new instance of the view to be inserted in the AppIntro layout.
     * This method is only called once for each creation of the activity.
     * <p>
     * [IndicatorControlleResourceTable.initialize] is called after this.
     *
     * @param context A context to be used for the view instantiation
     * @return An instance of the indicator view
     */
    Component newInstance(Context context);

    /**
     * Initialize the indicator view with the requested amount of elements.
     * As with [IndicatorControlleResourceTable.newInstance], this method is only called once for each
     * creation of the activity as well.
     * <p>
     * [IndicatorControlleResourceTable.newInstance] is called before this.
     *
     * @param slideCount The amount of slides present in the AppIntro
     */
    void initialize(int slideCount);

    /**
     * Select the position for the new page that became selected.
     * This method is called every time the selected page changed.
     *
     * @param index The index of the page that became selected
     */
    void selectPosition(int index);

    void setSelectedIndicatorColor(int selectedIndicatorColor);

    void setUnselectedIndicatorColor(int unselectedIndicatorColor);
}
